package eu.telecom_bretagne.CESI.servlet;

import java.io.IOException;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import eu.telecom_bretagne.CESI.service.IGestionDemande;
import eu.telecom_bretagne.CESI.service.IGestionValideur;

/**
 * Servlet implementation class LireValideur
 */
@WebServlet("/lire_valideur")
public class LireValideur extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public LireValideur() {
        super();
        // TODO Auto-generated constructor stub
    }


	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		// TODO: remplacer after par nom et prenom
		String valideur_id=request.getParameter("valideur_id");
		
//		try {
//			InitialContext ctx= new InitialContext();
//			IGestionValideur gestionValideur= 
//					(IGestionValideur)ctx.lookup(IGestionValideur.JNDI_NAME);
//			gestionValideur.lireValideur(Integer.parseInt(valideur_id));	
//			} catch (NamingException e) {
//			// TODO: handle exception
//			throw new ServletException(e);
//		}
		response.sendRedirect("liste_demandes_valideur.jsp?id="+Integer.parseInt(valideur_id));// TODO: mettre la page de liste des demandes
	}

}
